<template>
	<view class="page">
		<view class="input">
			消费：{{detail.score}}宝币
		</view>
		<view class="toEdit" @click="toEdit">确认支付</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				xiaofeiStr: "",
				detail: {}
			}
		},
		methods: {
			toEdit() {
				this.$post('user/payscore', {
					str: this.xiaofeiStr,
				}, (res) => {
					console.log(res)
					uni.showToast({
					    title: "支付成功!"
					})
					setTimeout(()=>{
						uni.switchTab({
							url:"/pages/my/my"
						})
					},1000)
				})
			},
			back() {
				uni.navigateBack();
			},
		},
		onLoad() {
			this.xiaofeiStr = uni.getStorageSync('xiaofeiStr');
			this.detail = JSON.parse(uni.getStorageSync('xiaofeiStr'))
		}
	}
</script>

<style>
	page {
		background-color: #FFFFFF;
	}

	.page {
		border-top: 20rpx solid #F6F6F6;
		padding: 0 60rpx;
	}

	.icon {
		width: 228rpx;
		height: 228rpx;
		display: block;
		margin: 0 auto;
		margin-top: 140rpx;
	}

	.text {
		margin-top: 20rpx;
		font-size: 34rpx;
		text-align: center;
	}

	.reason {
		color: #666666;
		font-size: 26rpx;
		margin-top: 200rpx;
	}

	.input {
		line-height: 98rpx;
		border-radius: 8rpx;
		margin-top: 120rpx;
		height: 98rpx;
		border: 1px solid #E5E5E5;
		text-align: center;
		margin-bottom: 30rpx;
	}

	.toEdit {
		line-height: 98rpx;
		background: #22BF8A;
		border-radius: 8rpx;
		color: #fff;
		font-size: 34rpx;
		text-align: center;
		margin-top: 68rpx;
	}

	.back {
		margin-top: 30rpx;
		border-radius: 8rpx;
		border: 1px solid #EEEEEE;
		line-height: 98rpx;
		font-size: 34rpx;
		text-align: center;
		color: #999999;
	}
</style>
